/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.view;

/**
 *
 * @author Joanna 8a
 */
public class PanelMaterias extends javax.swing.JPanel {

    /**
     * Creates new form PanelMaterias
     */
   public PanelMaterias(FramePrincipal parent) {
       this.parent = parent;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupOpcionesBusqueda = new javax.swing.ButtonGroup();
        jButtonGenerarHorario = new javax.swing.JButton();
        jButtonDeseoArmarMiHorario = new javax.swing.JButton();
        jPanelMisMaterias = new javax.swing.JPanel();
        jLabelTotalCrerditosMateria = new javax.swing.JLabel();
        jLabelNroCreditosMateria = new javax.swing.JLabel();
        jScrollPaneMisMaterias = new javax.swing.JScrollPane();
        jTableMisMaterias = new javax.swing.JTable();
        jPanelBusquedaMaterias = new javax.swing.JPanel();
        jLabelBuscarPor = new javax.swing.JLabel();
        jRadioButtonCodigoMateria = new javax.swing.JRadioButton();
        jRadioButtonNombreMateria = new javax.swing.JRadioButton();
        jTextFieldBusquedaMateria = new javax.swing.JTextField();
        jButtonBuscarMateria = new javax.swing.JButton();
        jPanelResultadosBusquedaMaterias = new javax.swing.JPanel();
        jScrollPaneResultadosBusquedaMaterias = new javax.swing.JScrollPane();
        jTableResultadosBusqueda = new javax.swing.JTable();

        jButtonGenerarHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonGenerarHorario.setText("Generar Horario Automáticamente");
        jButtonGenerarHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGenerarHorarioActionPerformed(evt);
            }
        });

        jButtonDeseoArmarMiHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonDeseoArmarMiHorario.setText("Deseo armar mi horario");

        jPanelMisMaterias.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mis materias", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), new java.awt.Color(153, 0, 0))); // NOI18N

        jLabelTotalCrerditosMateria.setFont(new java.awt.Font("Segoe UI Light", 1, 14)); // NOI18N
        jLabelTotalCrerditosMateria.setText("Total créditos: ");

        jLabelNroCreditosMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jLabelNroCreditosMateria.setText("0");

        jScrollPaneMisMaterias.setBorder(null);

        jTableMisMaterias.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTableMisMaterias.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null}
            },
            new String [] {
                "Código", "Materia", "Créditos"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPaneMisMaterias.setViewportView(jTableMisMaterias);

        javax.swing.GroupLayout jPanelMisMateriasLayout = new javax.swing.GroupLayout(jPanelMisMaterias);
        jPanelMisMaterias.setLayout(jPanelMisMateriasLayout);
        jPanelMisMateriasLayout.setHorizontalGroup(
            jPanelMisMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMisMateriasLayout.createSequentialGroup()
                .addGroup(jPanelMisMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPaneMisMaterias)
                    .addGroup(jPanelMisMateriasLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelTotalCrerditosMateria)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelNroCreditosMateria, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanelMisMateriasLayout.setVerticalGroup(
            jPanelMisMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMisMateriasLayout.createSequentialGroup()
                .addComponent(jScrollPaneMisMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelMisMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalCrerditosMateria)
                    .addComponent(jLabelNroCreditosMateria))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelBusquedaMaterias.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Busqueda de Materias", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), new java.awt.Color(0, 102, 51))); // NOI18N

        jLabelBuscarPor.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jLabelBuscarPor.setText("Buscar por");

        buttonGroupOpcionesBusqueda.add(jRadioButtonCodigoMateria);
        jRadioButtonCodigoMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jRadioButtonCodigoMateria.setText("Código");

        buttonGroupOpcionesBusqueda.add(jRadioButtonNombreMateria);
        jRadioButtonNombreMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jRadioButtonNombreMateria.setText("Nombre");

        jTextFieldBusquedaMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTextFieldBusquedaMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldBusquedaMateriaActionPerformed(evt);
            }
        });

        jButtonBuscarMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonBuscarMateria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/stickmanBuscarMateria.jpg"))); // NOI18N
        jButtonBuscarMateria.setText("Buscar");
        jButtonBuscarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscarMateriaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBusquedaMateriasLayout = new javax.swing.GroupLayout(jPanelBusquedaMaterias);
        jPanelBusquedaMaterias.setLayout(jPanelBusquedaMateriasLayout);
        jPanelBusquedaMateriasLayout.setHorizontalGroup(
            jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelBusquedaMateriasLayout.createSequentialGroup()
                .addGap(0, 136, Short.MAX_VALUE)
                .addGroup(jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelBusquedaMateriasLayout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addComponent(jTextFieldBusquedaMateria, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelBusquedaMateriasLayout.createSequentialGroup()
                            .addComponent(jLabelBuscarPor)
                            .addGap(404, 404, 404))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelBusquedaMateriasLayout.createSequentialGroup()
                            .addComponent(jRadioButtonCodigoMateria)
                            .addGap(121, 121, 121)
                            .addComponent(jRadioButtonNombreMateria)
                            .addGap(71, 71, 71)
                            .addComponent(jButtonBuscarMateria)
                            .addGap(128, 128, 128)))))
        );
        jPanelBusquedaMateriasLayout.setVerticalGroup(
            jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBusquedaMateriasLayout.createSequentialGroup()
                .addGroup(jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelBuscarPor)
                    .addGroup(jPanelBusquedaMateriasLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(jPanelBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonBuscarMateria)
                            .addComponent(jRadioButtonNombreMateria)
                            .addComponent(jRadioButtonCodigoMateria))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jTextFieldBusquedaMateria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30))
        );

        jPanelResultadosBusquedaMaterias.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Resultados Búsqueda", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), new java.awt.Color(0, 0, 204))); // NOI18N

        jTableResultadosBusqueda.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTableResultadosBusqueda.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null}
            },
            new String [] {
                "Créditos", "Materia", "Tipología"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                true, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPaneResultadosBusquedaMaterias.setViewportView(jTableResultadosBusqueda);

        javax.swing.GroupLayout jPanelResultadosBusquedaMateriasLayout = new javax.swing.GroupLayout(jPanelResultadosBusquedaMaterias);
        jPanelResultadosBusquedaMaterias.setLayout(jPanelResultadosBusquedaMateriasLayout);
        jPanelResultadosBusquedaMateriasLayout.setHorizontalGroup(
            jPanelResultadosBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPaneResultadosBusquedaMaterias)
        );
        jPanelResultadosBusquedaMateriasLayout.setVerticalGroup(
            jPanelResultadosBusquedaMateriasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelResultadosBusquedaMateriasLayout.createSequentialGroup()
                .addComponent(jScrollPaneResultadosBusquedaMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 26, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanelResultadosBusquedaMaterias, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelBusquedaMaterias, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelMisMaterias, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(97, 97, 97)
                .addComponent(jButtonDeseoArmarMiHorario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 112, Short.MAX_VALUE)
                .addComponent(jButtonGenerarHorario)
                .addGap(100, 100, 100))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanelBusquedaMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelResultadosBusquedaMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelMisMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonDeseoArmarMiHorario)
                    .addComponent(jButtonGenerarHorario))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonGenerarHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenerarHorarioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonGenerarHorarioActionPerformed
    
    private void jTextFieldBusquedaMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldBusquedaMateriaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldBusquedaMateriaActionPerformed

    private void jButtonBuscarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscarMateriaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonBuscarMateriaActionPerformed
    FramePrincipal parent;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupOpcionesBusqueda;
    private javax.swing.JButton jButtonBuscarMateria;
    private javax.swing.JButton jButtonDeseoArmarMiHorario;
    private javax.swing.JButton jButtonGenerarHorario;
    private javax.swing.JLabel jLabelBuscarPor;
    private javax.swing.JLabel jLabelNroCreditosMateria;
    private javax.swing.JLabel jLabelTotalCrerditosMateria;
    private javax.swing.JPanel jPanelBusquedaMaterias;
    private javax.swing.JPanel jPanelMisMaterias;
    private javax.swing.JPanel jPanelResultadosBusquedaMaterias;
    private javax.swing.JRadioButton jRadioButtonCodigoMateria;
    private javax.swing.JRadioButton jRadioButtonNombreMateria;
    private javax.swing.JScrollPane jScrollPaneMisMaterias;
    private javax.swing.JScrollPane jScrollPaneResultadosBusquedaMaterias;
    private javax.swing.JTable jTableMisMaterias;
    private javax.swing.JTable jTableResultadosBusqueda;
    private javax.swing.JTextField jTextFieldBusquedaMateria;
    // End of variables declaration//GEN-END:variables
}
